home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / BPNN133U.ZIP / NNERROR.C < prev    next >
C/C++ Source or Header  |  1992-11-19  |  918b  |  37 lines

  1. /*
  2. *----------------------------------------------------------------------------
  3. *    file:    nnerror.c
  4. *    desc:    define all errors
  5. *    by:    patrick ko
  6. *    date:    2 aug 91
  7. *----------------------------------------------------------------------------
  8. */
  9.  
  10. #include "nnerror.h"
  11.  
  12. struct error {
  13.     int    error;
  14.     char    *errmsg;
  15.     };
  16.  
  17. static struct error    errtbl[] =
  18.  
  19. {
  20.     { NNMALLOC,    "malloc error" },
  21.     { NNTFRERR,    "train file reading error" },
  22.     { NNRFRERR,    "recognition file reading error" },
  23.     { NNTFIERR,    "train file input error" },
  24.     { NNIOLAYER,    "input/output layer must be specified first" },
  25.     { NN2MANYLAYER,    "hidden layer more than specified" },
  26.     { NN2FEWPATT,    "no training pattern" },
  27.     { NN2MANYHIDDEN,"too many hidden layers specfied" },
  28.     { NNOUTNOTOPEN,    "output file cannot be opened" }
  29. };
  30.  
  31. int error( errno )
  32. int    errno;
  33. {
  34.     printf( "nnerror %d: %s\n", errno, errtbl[errno].errmsg );
  35.     exit (errno);
  36. }
  37.